<?php
namespace core\models;
/**
 * RPC服务器端【Yar】
 * @package core\models
 * @author  ZhouHaoHua <53027327@qq.com>
 * @package
 */
class Rpc_S_Yar implements Interface_Rpc_Server{
    private $server;
    /**
     * 创建一个RPC Server
     * @param Object|Object $obj
     * @param string        $protocol 采用哪种协议：默认http
     */
    public function __construct($obj, $protocol = 'http') {
        $this->server = new \Yar_Server($obj);
    }
    /**
     * 启动(发布)RPC Server
     * @return mixed
     * @author ZhouHaoHua <53027327@qq.com>
     */
    public function handle() {
        return $this->server->handle();
    }
}